<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%site}}".
 *
 * @property int $id
 * @property string $name 站点名称
 * @property int $type 站点类型
 * @property string $title 站点标题
 * @property string $domain 站点域名
 * @property string $setting 站点设置
 * @property string $uuid UUID
 * @property string $mark 备注
 * @property int $status 状态
 * @property string $created_at 创建时间
 * @property string $updated_at 更新时间
 */
class Site extends \common\db\ActiveRecord {

    use \common\traits\Constants;

    const STATUS_DELETED = -1;
    const STATUS_DEFAULT = 0;
    const STATUS_ACTIVE = 10;

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%site}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['name'], 'required'],
            [['type', 'status', 'created_at', 'updated_at'], 'integer'],
            [['setting'], 'string'],
            [['name', 'title', 'domain'], 'string', 'max' => 100],
            [['uuid'], 'string', 'max' => 32],
            [['mark'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'name' => '站点名称',
            'type' => '站点类型',
            'title' => '站点标题',
            'domain' => '站点域名',
            'setting' => '站点设置',
            'uuid' => 'UUID',
            'mark' => '备注',
            'status' => '状态',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }

}
